﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Observer
{
    public class ChineseFood
    {
        private String name;

        public delegate void ServeHandler(object sender);
        public event ServeHandler ServeEvent;

        // Chinese food with the food name
        public ChineseFood(String name)
        { this.name = name; }

        // Call this API to server
        public void Serve()
        {
            Notify();

            // code to serve the food
        }

        // Call to notify observers
        private void Notify()
        {
            if (ServeEvent != null)
                ServeEvent(this);
        }

        public String Name
        {
            get { return name; }
        }
    }
}
